package cn.jtfadmin.cms.domain.dto;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * cms 菜单信息
 * @author jtf
 * @since 0.0.2
 */
@Data
public class CmsPageMenuDTO implements Serializable {

    protected String id;

    /**
     * 菜单名称
     */
    protected String name;

    /**
     * 跳转链接
     */
    protected String url;

    /**
     * 内容html
     */
    protected String contentHtml;


    /**
     * 创建时间
     */
    protected LocalDateTime createDateTime;

    /**
     * logo
     *
     */
    protected String logo;

    /**
     * 子菜单类型
     */
    protected List<CmsPageMenuDTO> children;

    /**
     * 是否是当前菜单
     */
    protected boolean current;

    protected String style;

    public void setCurrent(boolean current){
        this.current = current;
        if(current){
            setStyle( "active");
        }
        setStyle( "");
    }

    public String getStyle(){
        if(current){
            return "active";
        }
        return "";
    }

}
